// 连接数据库
const mysql = require(`mysql`);
const dbConfig = require(`../config/dbconfig.js`)
const connection = mysql.createConnection(dbConfig);
//连接mysql
connection.connect(function(err){
    if(err){
        throw err;
    }
    console.log(`连接数据库成功，万岁`);
});

function dbQuery(sql,callback){
    connection.query(sql,callback);
}
// 暴露模块
module.exports = dbQuery;
